'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
  const {id} = event
  const db = uniCloud.database()
  let res = await db.collection('books').where({'_id':id}).get()
  if(res.affectedDocs == '0')
  return {
    code:0,
    msg:'未找到数据'
  }
  else{
    return {
      code:1,
      data:res.data
    }
  }
};
